export function numLimit(num, min, max) {
    let numInt = parseInt(num);
    if(isNaN(numInt)) return min;
    return Math.min(Math.max(numInt, min), max);
}